import axios from '../http';
import { HttpResponse } from '@/types/HttpResponse';
/**
 * @interface show_info
 * @property {string} name
 */
//封装接口方法
export interface phenum {
  phenom :string
}
export interface newUsername{
  newUsername: string
}
export class Myinfo {
  /**
   * @description 查询个人信息
   *
   * @return {HttpResponse} result
   */
  static async searchMyinfo(): Promise<HttpResponse> {
    return axios('/show_info', {
      method: 'get',
      responseType: 'json',
    });
  }
  static async changename(params:newUsername): Promise<HttpResponse> {
    return axios('/changeName', {
      method: 'post',
      responseType: 'json',
      params: params,
    });
  }
  static async resetphone(params : phenum ):Promise<HttpResponse> {
    return axios('/changePhoneNumber', {
      method: 'post',
      responseType: 'json',
      params:params,
    });
  }
}
